//EventEmitter 时间发射器的核心就是事件触发与事件倾听器功能的封装
let events = require('events')
let eventEmitter = new events.EventEmitter()

eventEmitter.on('run', function(){
    console.log("执行插件1")
})

eventEmitter.on('run', function(){
    console.log("执行插件2")
})

setTimeout(function(){
    eventEmitter.emit("run")
}, 1000)